package com.itheima.Thread.setDaemon守护线程;

public class Demo {
    //main也是一条普通线程
    public static void main(String[] args) {

        //先开启一条普通线程
        new Thread(() -> {
            for (int i = 0; i <= 5; i++) {
                System.out.println("刘备..." + i);
            }
        }).start();

        //再开一条守护线程
        Thread t1 = new Thread(() -> {
            for (int i = 0; i < 20; i++) {
                System.out.println("常山赵子龙..." + i);
            }
        });
        //将t1标记为守护线程,将运行结果打印持续到最后
        t1.setDaemon(true);
        t1.start();

        //  
        for (int i = 0; i <10; i++) {
            System.out.println("..阿斗。。"+i);
        }


    }
}
